<include file="public@head" />
</head>

<body>
    <div class="layui-fluid wrap js-check-wrap" id="component-tabs">
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">友情链接</div>
                    <div class="layui-card-body">
                        <div class="layui-tab">
                            <ul class="layui-tab-title">
                                <li class="layui-this"><a href="{:url('link/index')}">{:lang('ADMIN_LINK_INDEX')}</a></li>
                                <li><a href="{:url('link/add')}">{:lang('ADMIN_LINK_ADD')}</a></li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <form method="post" class="js-ajax-form layui-form" action="{:url('Link/listOrder')}">
                                        <div class="layui-btn-group">
                                            <button class="layui-btn layui-btn-xs js-ajax-submit" type="submit">{:lang('SORT')}</button>
                                            <button class="layui-btn layui-btn-normal layui-btn-xs js-ajax-submit" type="submit" data-action="{:url('link/toggle',array('display'=>1))}" data-subcheck="true">{:lang('DISPLAY')}
                                            </button>
                                            <button class="layui-btn layui-btn-normal layui-btn-xs js-ajax-submit" type="submit" data-action="{:url('link/toggle',array('hide'=>1))}" data-subcheck="true">{:lang('HIDE')}
                                            </button>
                                        </div>
                                        <php>$status=array("1"=>lang('DISPLAY'),"0"=>lang('HIDDEN'));</php>
                                        <table class="layui-table">
                                            <thead>
                                                <tr>
                                                    <th width="16"><input type="checkbox" lay-skin="primary" class="js-check-all" data-direction="x" data-checklist="js-check-x"></th>
                                                    <th width="50">{:lang('SORT')}</th>
                                                    <th width="50">ID</th>
                                                    <th>{:lang('NAME')}</th>
                                                    <th>链接地址</th>
                                                    <th width="50">{:lang('STATUS')}</th>
                                                    <th width="120">{:lang('ACTIONS')}</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <foreach name="links" item="vo">
                                                    <tr>
                                                        <td><input type="checkbox" lay-skin="primary" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}"></td>
                                                        <td><input name='list_orders[{$vo.id}]' class="input input-order mr5" type='text' size='3' value='{$vo.list_order}'></td>
                                                        <td>{$vo.id}</td>
                                                        <td>{$vo.name}</td>
                                                        <td><a href="{$vo.url}" target="_blank">{$vo.url}</a></td>
                                                        <td>{$status[$vo['status']]}</td>
                                                        <td>
                                                            <span class="layui-btn-group">
                                                                <a class="layui-btn layui-btn-xs layui-btn-normal" href="{:url('link/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
                                                                <a class="layui-btn layui-btn-xs layui-btn-danger" href="{:url('link/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">
                                                                    {:lang('DELETE')}
                                                                </a>
                                                            </span>
                                                        </td>
                                                    </tr>
                                                </foreach>
                                            </tbody>
                                            <tfoot>
                                                <tr>
                                                    <th width="16"><input type="checkbox" lay-skin="primary" class="js-check-all" data-direction="x" data-checklist="js-check-x"></th>
                                                    <th width="50">{:lang('SORT')}</th>
                                                    <th width="50">ID</th>
                                                    <th>{:lang('NAME')}</th>
                                                    <th>链接地址</th>
                                                    <th width="50">{:lang('STATUS')}</th>
                                                    <th width="120">{:lang('ACTIONS')}</th>
                                                </tr>
                                            </tfoot>
                                        </table>
                                        <div class="layui-btn-group">
                                            <button class="layui-btn layui-btn-xs js-ajax-submit" type="submit">{:lang('SORT')}</button>
                                            <button class="layui-btn layui-btn-normal layui-btn-xs js-ajax-submit" type="submit" data-action="{:url('link/toggle',array('display'=>1))}" data-subcheck="true">{:lang('DISPLAY')}
                                            </button>
                                            <button class="layui-btn layui-btn-normal layui-btn-xs js-ajax-submit" type="submit" data-action="{:url('link/toggle',array('hide'=>1))}" data-subcheck="true">{:lang('HIDE')}
                                            </button>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <include file="public@footer" />
</body>

</html>